<!DOCTYPE html>
<html>
<head>
    <title>js面向对象--继承(更简单的原型语法)</title>
    <meta charset="utf-8"/>
    <script>
//        function Persion(){
//        }
//       Persion.prototype = {
//           name: "NIke",
//           age: 28,
//           job: "Software",
//           sayName: function(){
//               alert(this.name);
//           }
//       };
//
//        var persion = new Persion();
//        alert(persion);
//        console.log(persion);
//        console.log(persion instanceof Object);
//        console.log(persion instanceof Persion);
//        console.log(persion.constructor == Persion);
//        console.log(persion.constructor == Object);


        function Persion(){
        }
        Persion.prototype = {
            constructor: Persion,
            name: "NIke",
            age: 28,
            job: "Software",
            sayName: function(){
                alert(this.name);
            }
        };

        var persion = new Persion();
        alert(persion);
        console.log(persion);
        console.log(persion instanceof Object);
        console.log(persion instanceof Persion);
        console.log(persion.constructor == Persion);
        console.log(persion.constructor == Object);
    </script>
</head>
<body>
</body>
</html>